package com.achang.achangmall.search.controller;

import com.achang.achangmall.search.service.MallSearchService;
import com.achang.achangmall.search.vo.SearchParam;
import com.achang.achangmall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/******
 @author 阿昌
 @create 2021-10-08 21:31
 *******
 */

@Controller
public class SearchController {

    @Autowired
    MallSearchService mallSearchService;

    @GetMapping("/list.html")
    public String listPage(SearchParam param, Model model ){
        SearchResult result = mallSearchService.search(param);
        model.addAttribute("result",result);
        return "list";
    }
}
